<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>小店</title>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<link href="/css/layout.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script type="text/javascript" src="/js/xiaodian.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->
<script type="text/javascript">
	
</script>

</head>

<body>
   <?php $this->load->view('head');?>
    <div class="w100p mb20">
    	<div class="w903 mg clearfix">
        	<div class="layout_left">
            	<!-- store -->
            	<div class="box_s5 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="main_show_box">
                        	<div class="lr_box">
                            	<div class="l_box">
                                	<a href="#" class="block"><img src="<?php echo site_url($store['photo'])?>" width="303" height="330" class="block" /></a>
                                    <div class="pic_title_bg"></div>
                                    <div class="pic_title_box">
                                    	<i class="icon_arrow_s1"></i><span><?php echo $store['name']?></span><div class="clear"></div>
                                    </div>	
                                </div>
                                <div class="r_box">
                                	<div class="show_box_s1"><a href="#" class="sb_title">UNICORN<i>(SHOP0001)</i></a></div>
                                    <div class="show_box_s1 sb_info">
                                    	<p>地址：<?php echo $store['address']?></p>
                                        <p>类别：饰品店</p>
                                        <p>风格：魔幻时尚服饰</p>
                                        <p>营业时间：<?php echo $store['bustime']?></p>
                                        <p>电话：<?php echo $store['phone']?></p>
                                    </div>
                                    <div class="show_box_s1 sb_btn tc">
                                    	<a href="#" class="def_btn_s17 btn">店主认证</a>
                                    </div>
                                    <div class="adder fr mr10 mt10">
                                		<a href="#" class="user"><?php echo $store['creator']?></a><span class="ml10"><?php echo date('Y-m-d',$store['createtime']);?></span>&nbsp;添加
                                	</div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                        </div>
                        <div class="rela_nums store_nums">
                        	<div class="rela_ope fr">
                            	<a href="#" id="fav_store"><i class="icon_heart_s1 mr5"></i>收藏<b><?php echo $store['favorites']?></b></a>
                                <a href="javascript:;" suptype="recommends" class="supts"><i class="icon_voice mr5"></i>推荐<b><?php echo $store['recommends']?></b></a>
                                <a href="#comments"><i class="icon_pen mr5"></i>评论</a>
                            </div>
                            <div class="fl">
                                <div class="love_nums" id="love_nums" style="cursor: pointer;">
                                    <i class="icon_heart"></i><span>喜欢<b><?php echo $store['loves']?></b></span>
                                </div>
                                <span class="else"><a href="javascript:;" id="supt_manager" suptype="suptor" class="supts">支持店主<b><?php echo $store['suptor']?></b></a></span>
                                <span class="else"><a href="javascript:;" id="supt_name" suptype="suptname" class="supts">支持店名<b><?php echo $store['suptname']?></b></a></span>
                                <span class="else"><a href="javascript:;" id="supt_best" suptype="suptbest" class="supts">支持镇店之宝<b><?php echo $store['suptbest']?></b></a></span>
                            </div>
                            <div class="clear"></div>
                        </div>
                        
                        <div class="impression_tags store_tags">
                            田子坊：<a href="#" >维多利亚</a><a href="#">复古</a><a href="#">饰品店</a><a href="#">nuicom</a>
                        </div>
                        
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- store--end -->
                
                <!-- culture -->
                <div class="box_s5 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box">
							<h1>小店文化</h1>
                            <p class="culture_info">
                            	<?php echo $store['history']?>
                            </p>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- culture--end-->
                  
                <!-- store_pic -->
                <div class="box_s5 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box">
							<h1 class="espe"><a href="#" class="more fr mr10">more</a><a href="#" class="def_btn_s12 mr10 fr">添加图片</a>小店图片<br class="clear" /></h1>
                            <ul class="road_pic">
                            	<?php foreach ($photoList as $key=>$photo):?>
                            		<li <?php if($key == 2):?>class="last"<?php endif;?>><a href="#" class="block"><img src="<?php echo site_url($photo['imagePath'])?>" width="172" height="124" class="block" /></a></li>
                            	<?php endforeach;?>
                            	
                            </ul>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- store_pic--end-->
                
                <!-- road_store-->
                <div class="box_s5 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box">
							<h1 class="espe"><a href="#" class="more fr mr10">more</a>同条路上的小店<br class="clear" /></h1>
                            <ul class=" road_store">
                            	<?php foreach ($storeList as $st):?>
                            		<li>
	                                	<a href="#" class="block"><img src="<?php echo $st['photo']?>" width="82" height="82" class="block" /></a>
	                                    <p class="store_name"><?php echo $st['name']?></p>
	                                </li>
                            	<?php endforeach;?>
                            	
                               
                            </ul>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- road_store--end-->
                
                <!-- store_comment -->
                <div class=" com_box_s1">
                	<h1><a href="#" class="more fr">more</a>小店评论<div class="clear"></div></h1>
                    <ul class="comment_list lr_box mt15 i_store_list">
                    	
                        <?php foreach ($commentList as $comment):?>
                        	<li>
	                            <div class="l_box"><a href="#"><img width="62" height="62" src="<?php echo site_url($comment['avatar']) ?>" class="block" /></a></div>
	                            <div class="r_box">
	                                <p class="info">                                        	
	                                    <a href="#"><?php echo replaceExpress($comment['content'])?></a>
	                                </p>
	                                <div class="comment_else">
	                                    <div class="comment_nums">
	                                        <span>支持 [<a href="#">0</a>]</span>
	                                        &nbsp;<a target="_blank" href="<?php echo site_url('replylist/'.$comment['id'].'/4')?>" class="c_reply"><span>回复 </span>[<?php echo $comment['replys']?>]</a>
	                                    </div>
	                                    <span>来自：<a href="#" class="author"><?php echo $comment['username']?></a>&nbsp;<?php echo date('Y-m-d',$comment['createtime']);?>  </span>
	                                </div>
	                            </div>
	                            <div class="clear"></div>
	                            <!-- 
	                            <?php if (count($comment['replyList']) > 0):?>
	                            <div class="box_s7 ml5 mt15">
		                            <div class="b_head"></div>
	                            <?php foreach ($comment['replyList'] as $reply):?>
	                            	
		                                <div class="content">
		                                	<ul class="feedback_list">
		                                    	<li>
		                                        	<div class="lr_box">
		                                            	<div class="l_box">
		                                                	<a href="<?php echo site_url('tamember?id='.$reply['memberId'])?>"><img src="<?php echo $reply['avatar']?>" width="64" height="64" /></a>
		                                                    <a href="<?php echo site_url('tamember?id='.$reply['memberId'])?>" class="name"><?php echo $reply['username']?></a>
		                                                </div>
		                                                <div class="r_box">
		                                                	<p class="info"><?php echo replaceExpress($reply['content'])?></p>
		                                                </div>
		                                            </div>
		                                        </li>
		                                    </ul>
		                                </div>
		                               
	                            <?php endforeach;?>
	                            	 <div class="b_foot"></div>
	                                <i class="icon_arrow_s4"></i>
	                            </div>
	                            <?php endif;?>
	                             -->
	                            <div class="com_comment" style="display:none;">

	                                <div class="main_comment">
	                                    <ul class="face_box">
	                                        <li express="[大笑]"><img src="../../images/others/face_1.png" /></li>
			                                <li express="[惊讶]"><img src="../../images/others/face_2.png" /></li>
			                                <li express="[害羞]"><img src="../../images/others/face_3.png" /></li>
			                                <li express="[哈切]"><img src="../../images/others/face_4.png" /></li>
			                                <li express="[白眼]"><img src="../../images/others/face_5.png" /></li>
			                                <li express="[大哭]"><img src="../../images/others/face_6.png" /></li>
			                                <li express="[偷笑]"><img src="../../images/others/face_7.png" /></li>
			                                <li express="[示爱]"><img src="../../images/others/face_8.png" /></li>
	                                    </ul>
	                                        <table class="com_form issue_comment">
	                                            <tbody>
		                                            <tr>
		                                                <td><textarea class=" def_ta_s5" name="info" style="width: 561px;"></textarea><br class="clear"><div class="validate_v" /></td>
		                                            </tr>
		                                            <tr>
		                                                <td class="tr"><input replyId="<?php echo $comment['id']?>" type="button" value="提交" class="def_btn_s9 mt5 submit reply_comment" /></td>
		                                            </tr>
	                                        	</tbody>
	                                        </table>
	                                </div>
	                            </div>
	                        </li>
                        <?php endforeach;?>
                        
                        
                    </ul>
                </div>
                <!-- store_comment--end-->
                
                <!-- add_store_comment-->
                <div class=" com_box_s1">
                	<a name="comments"></a>
                	<h1>评论本店</h1>
                    <!-- comment_frame -->
                    <div class="com_comment">
                        <div class="main_comment">
                            <ul class="face_box">
                                <li express="[大笑]"><img src="../../images/others/face_1.png" /></li>
                                <li express="[惊讶]"><img src="../../images/others/face_2.png" /></li>
                                <li express="[害羞]"><img src="../../images/others/face_3.png" /></li>
                                <li express="[哈切]"><img src="../../images/others/face_4.png" /></li>
                                <li express="[白眼]"><img src="../../images/others/face_5.png" /></li>
                                <li express="[大哭]"><img src="../../images/others/face_6.png" /></li>
                                <li express="[偷笑]"><img src="../../images/others/face_7.png" /></li>
                                <li express="[示爱]"><img src="../../images/others/face_8.png" /></li>
                            </ul>
                            <form action="" id="store_comment">
                                <table class="com_form issue_comment">
                                    <tbody><tr>
                                        <td><textarea class=" def_ta_s6" name="info" id="comment_content"></textarea><br class="clear"><div class="validate_v"></div></td>
                                    </tr>
                                    <tr>
                                        <td class="tl"><input type="button" id="comment_button" value="评论" class="def_btn_s13 mt10 submit" /></td>
                                    </tr>
                                </tbody></table>
                            </form>
                        </div>
                    </div>
                    <!-- comment_frame--end-->
                </div>
                <!-- add_store_comment--end-->
                
            </div>
            
            <div class="layout_right">
            	
                <!-- notice -->
            	<div class="box_s6 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box">
                        	<h1>小店最新公告</h1>
                            <ul class="notice">
                            	<?php foreach ($announceList as $announce):?>
                            		<li>
	                                	<div class="clearfix">
	                                		<p class="title"><a href="#"><?php echo $announce['title']?></a></p>
	                                        <div class="clear"></div>
	                                    </div>
	                                </li>
                            	<?php endforeach;?>
                            	
                               
                            </ul>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- notice--end-->
                
                <!-- store_map -->
                <div class="box_s6 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box_s2 map_wrap">
                        	<h1>小店地图</h1>
                            <div class="map_box">
                            	<?php echo $store['map']?>
                            </div>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- store_map--end-->
                
                <!-- impression -->
                <div class="box_s6 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box">
                        	<h1>给本店留下的最深刻的印象</h1>
                            <div class="impression">
                            	<textarea id="tag_content"></textarea><input type="botton" id="tag_button" value="印象" class="def_btn_s14"/>
                                <br class="clear" />
                            </div>
                            <div class="impression_tags">
                            	<a href="#" class="special">维多利亚</a><a href="#">复古</a><a href="#">饰品店</a><a href="#">nuicom</a>
                            </div>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- impression--end-->
                
                <!-- ruzhu -->
                <div class="box_s6 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box">
                        	<h1 class="espe"><a href="#" class="more fr mr10">more</a>收藏本店的会员有</h1>
                            <ul class="rz_list">
                            	<?php foreach ($favList as $fav):?>
                            		<li>
	                                	<a href="<?php echo site_url('tamember?id='.$fav['id'])?>" class="block"><img src="<?php echo $fav['avatar']?>" width="62" height="62" class="block" /></a>
	                                    <a href="<?php echo site_url('tamember?id='.$fav['id'])?>" class="name"><?php echo $fav['username']?></a>
	                                </li>
                            	<?php endforeach;?>
                            	
                            </ul>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- ruzhu--end-->
                
                <!-- resident -->
                <div class="box_s6 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box">
                        	<h1>友情链接</h1>
                            <ul class="friend_list">
                            	<?php foreach ($friendlink as $adv):?>
                            	<li>
                                	<div class="lr_box">
                                        <div class="l_box">
                                            <a href="<?php echo $adv['link']?>" target="_blank"><img src="<?php echo site_url($adv['image'])?>" width="62" height="62" class="block" /></a>
                                        </div>
                                        <div class="r_box">
                                            <p class="name"><a href="<?php echo $adv['link']?>" target="_blank"><?php echo $adv['title']?></a></p>
                                        </div>
                                    </div>
                                </li>
                            		
                            	<?php endforeach;?>
                            	
                                
                            </ul>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- resident--end-->
                
                
            </div>
            
            <div class="clear"></div>
            
        </div>
    </div>
    
   <?php $this->load->view('foot')?>
</body>
<script type="text/javascript">
$(function(){
	//喜欢
	$("#love_nums").click(function(){
		if(xiaodian.checkLogin()){
			$.post("<?php echo site_url('member/love')?>",{
				loveType:2,
				loveId:'<?php echo $eID?>'
			},function(data){
					var ret = $.parseJSON(data);
					if(ret.success == 'true'){
						var loves = $("#love_nums b");
						loves.text(parseInt(loves.text())+1);	
					}else{
						alert(ret.msg);
					}
					
				});
		}else{
			window.location.href="<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('store?id='.$eID)?>";
		}
		
	});
	//收藏
	$("#fav_store").click(function(){
		if(xiaodian.checkLogin()){
			$.post("<?php echo site_url('member/favor')?>",{
				favorType:2,
				favorId:'<?php echo $eID?>'
			},function(data){
					var ret = $.parseJSON(data);
					if(ret.success == 'true'){
						var favor = $("#fav_store b");
						favor.text(parseInt(favor.text())+1);	
					}else{
						alert(ret.msg);
					}
					
				});
		}else{
			window.location.href="<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('store?id='.$eID)?>";
		}
		
	});
	
	$("#comment_button").click(function(){
		var content = $("#comment_content").val();
		if(content == null || content ==''){
			alert('评论不能为空');
			return ;
		}

		$.post("<?php echo site_url('member/savecomment')?>",{
			type:2,
			belongId:'<?php echo $eID?>',
			content:content
		},function(data){
				var ret = $.parseJSON(data);
				if(ret.success == 'true'){
					window.location.reload();
				}else{
					alert(ret.msg);
				}
				
			});
	});
	$("#tag_button").click(function(){
			var content = $("#tag_content").val();
			if(content == null || content == ''){
				alert('印象不能为空');
			}else{
				$.post('<?php echo site_url('member/savetag')?>',{
						name:content,
						eID:'<?php echo $eID?>'
					},function(data){
						var ret = $.parseJSON(data);
						alert(ret.msg);
						if(ret.success=='true'){
							$("#tag_content").val('');
						}
					});
			}
		});

//	$.defaults.commentReply("<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('store?id='.$eID)?>");

	$(".reply_comment").click(function(){
		
		var content = $(this).parent().parent().parent().find("textarea[name='info']").val();
		if(content == null || content ==''){
			alert('评论不能为空');
			return ;
		}

		$.post("<?php echo site_url('member/replycomment')?>",{
			type:4,
			belongId:$(this).attr('replyId'),
			content:content
		},function(data){
				var ret = $.parseJSON(data);
				if(ret.success == 'true'){
					window.location.reload();
				}else{
					alert(ret.msg);
				}
				
			});
	});

	$(".supts").click(function(){
		var obj = $(this);
		$.post('<?php echo site_url('store/supports')?>',{
				suptId:'<?php echo $store['id']?>',
				suptype:$(this).attr("suptype")
			},function(data){
				var ret = $.parseJSON(data);
				if(ret.success=='true'){
					var oldNum = obj.find("b").text();
					obj.find("b").text(parseInt(oldNum)+1);
				}else{
					alert(ret.msg);
				}
			})
			
	});
})
</script>
</html>
